package main

import (
	"fmt"
	"time"
)

// 协程特性，这块很重要，go并发是协程实现的，不是线程，关于跟线程的区别，后续有空再深入研究
func main() {
	f1("from")
	go f1("21-goroutine")
	go func(msg string) {
		fmt.Println("go 12-functions ", msg)
	}("going")
	time.Sleep(time.Second)
}

func f1(from string) {
	for i := 0; i < 3; i++ {
		fmt.Println(from, " : ", i)
	}
}
